Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tool to deserialize alertmanager state file #20

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

mustafain117
Copy link

@mustafain117 mustafain117 commented Feb 9, 2024

Tool to de-serialize alertmanger fullstate file. Reads from file to protobuf and converts output to JSON.
Writes output to the std out by default, configurable to write results to file.

Example:
compile using: make deserializer
run:

/workspaces/cortex-tools (fullstate-tool) $ cmd/deserializer/deserializer --file fullstate_example

output:

----
Alerts:
{"entry":{"group_key":"e30ve306e2FsZXJ0bmFtZT0iUjFBbGVydCIsIGV4dHJhPSJleHRyYXZhbCIsIHI9InYiLCBzb3hfY29udHJvbD0iZmFsc2UifQ==","receiver":{"group_name":"example-sns-empty-message","integration":"sns"},"timestamp":"2024-02-06T05:56:19.450235099Z","firing_alerts":[13614561806562461970]},"expires_at":"2024-02-06T06:00:19.450235099Z"}
{"entry":{"group_key":"e30ve306e2FsZXJ0bmFtZT0iUjFBbGVydCIsIGV4dHJhPSJleHRyYXZhbCIsIHI9InYiLCBzb3hfY29udHJvbD0iZmFsc2UifQ==","receiver":{"group_name":"example-sns-unicode-subject","integration":"sns"},"timestamp":"2024-02-06T05:56:19.499648422Z","firing_alerts":[13614561806562461970]},"expires_at":"2024-02-06T06:00:19.499648422Z"}

----
Silences:
{"silence":{"id":"d8b850ec-c2fa-4202-aabc-ba1f4587e748","matchers":[{"type":2,"name":"sox_control","pattern":"false"}],"starts_at":"2024-01-31T23:07:47.182830158Z","ends_at":"2024-02-26T22:12:33.533330795Z","updated_at":"2024-01-31T23:07:47.182830158Z","created_by":"api","comment":"Silence updated"},"expires_at":"2024-03-02T22:12:33.533330795Z"}

@mustafain117 mustafain117 changed the title [WIP] Add tool to deserialize alertmanager state file Add tool to deserialize alertmanager state file Feb 12, 2024
@mustafain117 mustafain117 marked this pull request as ready for review February 12, 2024 19:55
@friedrichg
Copy link
Member

@mustafain117 lint is failing

Signed-off-by: Mustafain Ali Khan <[email protected]>
Copy link
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks. very interesting

@friedrichg friedrichg merged commit 9481a59 into cortexproject:main Feb 13, 2024
4 checks passed
friedrichg pushed a commit that referenced this pull request May 9, 2024
* Add tool to deserialize alertmanager state file

Signed-off-by: Mustafain Ali Khan <[email protected]>

* fix lint

Signed-off-by: Mustafain Ali Khan <[email protected]>

---------

Signed-off-by: Mustafain Ali Khan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants